gdksurface-win32.c: Fix Aerosnap computation
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 3 Aug 2020 08:01:40 +0000 (16:01 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Wed, 5 Aug 2020 07:38:08 +0000 (15:38 +0800)
commit06f28af80ff57ae42f3b3a951d33e8d43e08352c
tree57026df0d8d5e7fd5f064351ed00643327d064ac
parente60d6f70bfb48020485bc35c3b6614521b74f5d5
gdksurface-win32.c: Fix Aerosnap computation

Don't get the default display when we compute the Aerosnap region, but instead
get it from the underlying GdkSurface that we are using for the computation.

Also, don't unref the monitors that we obtain from the display in the wrong
place, which was why we had crashes whenever we triggered AeroSnap code (and we
are actually not supposed to do that as they are owned by the GdkDisplay that
is owned by the GdkSurface we are using), and this will eliminate lots of
criticals that are spewed as a result.
gdk/win32/gdksurface-win32.c